'use strict';
// exports.main = async (event, context) => {
// 	//event为客户端上传的参数
// 	console.log('event : ', event)
	
// 	//返回数据给客户端
// 	return event
// };
const uniPush = uniCloud.getPushManager({appId:"__UNI__8096E63"}) //注意这里需要传入你的应用appId，用于指定接收消息的客户端
// const clientid = uni.$_getStorage('unipush_id')
exports.main = async (event, context) => {
	console.log(event)
	console.log(context)
	const obj = JSON.parse(event.body);
	//event为客户端上传的参数
	return await uniPush.sendMessage({
		"push_clientid": obj.cid, 	//填写上一步在uni-app客户端获取到的客户端推送标识push_clientid
		"title": obj.title,	
		"request_id":obj.requestId,
		"force_notification":true,
		"content": obj.content,
		"payload": obj.payload,
		"path":obj.path,
		
	})
};
